<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
    <base href="${basePath}">
    <#include "common/top.html"/>
</head>
<body style="background:#fff;">
<form class="layui-form" modelAttribute="uSensor" name="form1" id="form1" method="post">
    <div class="layui-form-item-dept">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>级别：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="sensorLevel" id="sensorLevel" maxlength="50"
                           placeholder="这里输入级别" title="级别"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">定时邮件：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="useemaildingshi" id="useemaildingshi" maxlength="50"
                           placeholder="这里输入定时邮件" title="定时邮件"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>通道号：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="idchannel" id="idchannel" maxlength="50"
                           placeholder="这里输入通道号" title="通道号"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">开启定时发送：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="usedingshi" id="usedingshi" maxlength="50"
                           placeholder="这里输入开启定时发送" title="开启定时发送"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>所属矿：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="idmine" id="idmine" maxlength="50"
                           placeholder="这里输入所属矿" title="所属矿"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">短信：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="usesmswarning" id="usesmswarning" maxlength="50"
                           placeholder="这里输入短信" title="短信"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">报警处理-红色-低：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningbottom3" id="warningbottom3" maxlength="50"
                           placeholder="这里输入报警处理-红色-低" title="报警处理-红色-低"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">报警处理-黄色-低：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningbottom1" id="warningbottom1" maxlength="50"
                           placeholder="这里输入报警处理-黄色-低" title="报警处理-黄色-低"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">报警处理-橙色-高：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningtop2" id="warningtop2" maxlength="50"
                           placeholder="这里输入报警处理-橙色-高" title="报警处理-橙色-高"/>
                </div>
            </div>

        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">单位值 /分钟：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="tubianValue" id="tubianValue" maxlength="50"
                           placeholder="这里输入单位值 /分钟" title="单位值 /分钟"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">纬度：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="gisY" id="gisY" maxlength="50"
                           placeholder="这里输入纬度" title="纬度"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">里程限制下线：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="rangel" id="rangel" maxlength="50"
                           placeholder="这里输入里程限制下线" title="里程限制下线"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>地图显示：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="gisuse" id="gisuse" maxlength="50"
                           placeholder="这里输入地图显示" title="地图显示"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">开启里程限制：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="userange" id="userange" maxlength="50"
                           placeholder="这里输入开启里程限制" title="开启里程限制"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>状态：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="state" id="state" maxlength="50"
                           placeholder="这里输入状态" title="状态"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">计算公式：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="formula" id="formula" maxlength="50"
                           placeholder="这里输入计算公式" title="计算公式"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>类型id：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="sensorTypeId" id="sensorTypeId" maxlength="50"
                           placeholder="这里输入类型id" title="类型id"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>所属分站：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="code" id="code" maxlength="50"
                           placeholder="这里输入所属分站" title="所属分站"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">定时短信：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="usesmsdingshi" id="usesmsdingshi" maxlength="50"
                           placeholder="这里输入定时短信" title="定时短信"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>分站站号=u_station表：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="stationId" id="stationId" maxlength="50"
                           placeholder="这里输入分站站号=u_station表" title="分站站号=u_station表"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">邮件：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="useemailwarning" id="useemailwarning" maxlength="50"
                           placeholder="这里输入邮件" title="邮件"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">开启报警：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="usewarning" id="usewarning" maxlength="50"
                           placeholder="这里输入开启报警" title="开启报警"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>机构号：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="groupId" id="groupId" maxlength="50"
                           placeholder="这里输入机构号" title="机构号"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">报警处理-橙色-低：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningbottom2" id="warningbottom2" maxlength="50"
                           placeholder="这里输入报警处理-橙色-低" title="报警处理-橙色-低"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">报警处理-黄色-高：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningtop1" id="warningtop1" maxlength="50"
                           placeholder="这里输入报警处理-黄色-高" title="报警处理-黄色-高"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">突变报警：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="tubianUse" id="tubianUse" maxlength="50"
                           placeholder="这里输入突变报警" title="突变报警"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">报警处理-红色-高：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="warningtop3" id="warningtop3" maxlength="50"
                           placeholder="这里输入报警处理-红色-高" title="报警处理-红色-高"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">经度：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="gisX" id="gisX" maxlength="50"
                           placeholder="这里输入经度" title="经度"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">里程限制上限：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="rangeh" id="rangeh" maxlength="50"
                           placeholder="这里输入里程限制上限" title="里程限制上限"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">排序号：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="sortnum" id="sortnum" maxlength="50"
                           placeholder="这里输入排序号" title="排序号"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>度量单位：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="measureName" id="measureName" maxlength="50"
                           placeholder="这里输入度量单位" title="度量单位"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">处理方式：</label>
                <div class="layui-input-inline">
                    <@c.dictselect type='formulaType' code=''>
                </@c.dictselect>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>类型：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="sensorTypeName" id="sensorTypeName" maxlength="50"
                           placeholder="这里输入类型" title="类型"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span
                    style="color: red;">*</span>安装地址：</label>
            <div class="layui-input-inline">
                  <textarea name="address" id="address" class="layui-textarea"
                                          placeholder="这里输入安装地址"></textarea>
            </div>
        </div>


    </div>
</form>
</body>
<script type="text/javascript">

    layui.use(['form', 'table', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        form.render();

    });


    function submitHandler() {
        var prefix = basePath + "device/sensor";
        $.operate.post(prefix + '/addUSensor', $("#form1").serializeArray(), function (result) {
            if (result.status == true) {
                layer.alert(result.msg, function (index) {
                    var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index1);
                    layer.close(index);
                });
            } else {
                parent.layer.alert(result.msg);
            }
        });
    }
</script>
</body>
</html>
